package com.suwish.pc.ui.component.list;

import java.awt.Color;
import java.awt.Component;

import javax.swing.JList;
import javax.swing.ListCellRenderer;
import javax.swing.UIManager;

/**
 * 
 * @author Min
 *
 */
public class FileListCellRenderer implements ListCellRenderer {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Override
	public Component getListCellRendererComponent(JList list, Object value,
			int index, boolean isSelected, boolean cellHasFocus) {
		Component element = (Component)value;
		if(isSelected){
			element.setBackground(Color.LIGHT_GRAY);
			element.setForeground(Color.BLUE);
		}else{
			element.setBackground(UIManager.getColor("List.background"));
			element.setForeground(Color.BLACK);
		}
		return element;
	}

}
